package com.ryan.quartz.temp.factory;

/**
 * 工厂自营店
 *
 * @author Rayn on 2017/10/29.
 * @email liuwei412552703@163.com.
 */
public class PizzaStore {

    protected SimplePizzaFactory factory;

    public PizzaStore(SimplePizzaFactory factory) {
        this.factory = factory;
    }

    public Pizza orderPizza(String type) {
        Pizza pizza = null;

        pizza = factory.create(type);


        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }
}
